package com.xiaofeng.wx.hadnler;

/**
 * @Author: chc
 * @Date: 2024/02/26/19:21
 * @Description: 枚举
 */
public enum  WxChatMsgTypeEnum {
    SUBSCRIBE("event.subscribe","用户关注事件"),
    TEXT_MSG("text","接收用户文本消息");

    private String msgType;

    public String desc;

    WxChatMsgTypeEnum(String msgType,String desc){
        this.msgType = msgType;
        this.desc = desc;
    }

    public static WxChatMsgTypeEnum getByMsgType(String msgType){
        for (WxChatMsgTypeEnum wxChatMsgTypeEnum : WxChatMsgTypeEnum.values()){
            if(wxChatMsgTypeEnum.msgType.equals(msgType)){
                return wxChatMsgTypeEnum;
            }
        }
        return null;
    }
}
